<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  //在入口文件注册web3和contract
  async beforeCreate() {
    if (!this.$store.state.web3.web3Instance) {
      console.log("registerWeb3 Action dispatched from login.vue");
      await this.$store.dispatch("registerWeb3");
    }
  },
  mounted() {
    console.log('dispatching getContractInstance');
    this.$store.dispatch('getContractInstance');
  },
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
